﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MCInfomationM.aspx.cs" Inherits="OLPC_MCInfomationM" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxUploadControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1.Export, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxClasses" tagprefix="dx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>收款信息维护</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../Styles/main.css" rel="Stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="../Jscript/common.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div id="headlocation" class="headlocation">
            <asp:Label ID="lblLocation" runat="server" Text="当前位置"></asp:Label>
            <img alt="当前位置" src="../Image/weizhi.gif" />>>
            <asp:Label ID="Label1" runat="server" Text="收款信息维护"></asp:Label>
        </div>
        <div id="covertDiv" class="transp" style="display:none;"></div>    
        <div style="margin:15px 5px 10px 5px;">
        <asp:UpdatePanel ID="udp" runat="server">
            <ContentTemplate> 
                <asp:UpdateProgress ID="UpdateProgress3" runat="server">    
                    <ProgressTemplate>
                        <div class="transp" style="text-align:center; padding: auto auto;"><span style="font-size:25px; color:Blue;">Data Loading..... </span></div>           
                    </ProgressTemplate>
                </asp:UpdateProgress>                     
                <dx:ASPxPageControl ID="tc" runat="server" ActiveTabIndex="0" 
                    CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua"
                    SpriteCssFilePath="~/App_Themes/Aqua/{0}/sprite.css" TabSpacing="3px" 
                    Width="100%">
                    <TabPages>
                        <dx:TabPage Name="tabmcinformation" Text="收款信息">                       
                           <ContentCollection>
                                <dx:ContentControl ID="ContentControl1" runat="server">
                                    <div class="mcinformation">
                                        <div style="margin:10px 20px 5px 45px; width:100%; height:25px;">
                                            <div style="text-align:right; font-size:18px; float:left; width:140px; margin:5px 0px 0px 0px; font-weight:bold;">
                                                <asp:Label ID="Label4" runat="server" Text="请选择公司："></asp:Label>
                                            </div>
                                            <div style="margin:5px 0 0 5px;">
                                                <dx:ASPxComboBox ID="cbcompany" runat="server" AutoPostBack="true" 
                                                    OnSelectedIndexChanged="cbcompany_SelectedIndexChanged">
                                                </dx:ASPxComboBox>
                                            </div>
                                        </div>
                                    </div>
                                    <dx:ASPxGridView ID="gvimported" runat="server" ClientInstanceName="gvimported" Width="100%" 
                                        KeyFieldName="AccountStatementItemCode"
                                        AutoGenerateColumns="False" 
                                        OnAfterPerformCallback="gv_AfterPerformCallback"
                                        OnRowCommand="gv_RowCommand">
                                        <Columns>
                                            <dx:GridViewDataColumn Caption="编辑" Width="40px" FixedStyle="Left">
                                                <DataItemTemplate>
                                                    <asp:Button runat="server"
                                                     CommandArgument='<%# Eval("AccountStatementItemCode") %>' CommandName="edit"
                                                     CssClass="cmdStylegvedit"
                                                     Visible='<%# Exported(Convert.ToString(Eval("StateValue"))) %>'>
                                                    </asp:Button>
                                                </DataItemTemplate>
                                                <CellStyle HorizontalAlign="Center" VerticalAlign="Middle">
                                                </CellStyle>
                                            </dx:GridViewDataColumn>
                                            <dx:GridViewDataColumn Caption="删除" Width="40px" FixedStyle="Left">
                                                <DataItemTemplate>
                                                    <asp:Button ID="Button1" runat="server" 
                                                     CommandArgument='<%# Eval("AccountStatementItemCode") %>'
                                                     CommandName="delete" OnClientClick="return confirm('你确定要移除');"
                                                     Visible='<%# Exported(Convert.ToString(Eval("StateValue"))) %>'
                                                     CssClass="cmdStylegvdelete" />
                                                </DataItemTemplate> 
                                                <CellStyle HorizontalAlign="Center">
                                                </CellStyle>
                                            </dx:GridViewDataColumn>
                                            <dx:GridViewDataTextColumn Caption="手续费" 
                                                FieldName="HandlingFeeShowName" Width="55px" FixedStyle="Left">
                                                <Settings AutoFilterCondition="Equals" ShowFilterRowMenu="False" />
                                                <DataItemTemplate>
                                                    <dx:ASPxCheckBox  runat="server" AutoPostBack="true" ID="chkhgv"
                                                        Checked='<%# GetVisible(Convert.ToString(Eval("HandlingFee"))) %>' 
                                                        ToolTip='<%# GetHandlingFee(Convert.ToString(Eval("AccountStatementItemCode"))) %>' 
                                                        Enabled='<%# Exported(Convert.ToString(Eval("StateValue"))) %>'
                                                        Text='<%# Eval("HandlingFeeShowName") %>'                           
                                                        oncheckedchanged="chk_CheckedChanged_gv">
                                                    </dx:ASPxCheckBox>
                                                    <%--                                              
                                                    <input type="checkbox" id="chkdd" 
                                                     checked='<%# GetVisible2(Convert.ToString(Eval("AccountStatementItemCode"))) %>'
                                                     onclick="ChkImportedClick('txtAccountStatementItemCodeHandlingFee',this.id);" 
                                                     disabled='<%# Exported2(Convert.ToString(Eval("StateValue"))) %>'
                                                      value='<%# GetHandlingFee2(Convert.ToString(Eval("AccountStatementItemCode"))) %>' runat="server" />
                                                    <script language="javascript" type="text/javascript">
                                                        function ChkImportedClick(strid, tempid) {
                                                            var obj = document.getElementById(tempid);
                                                            var code = obj.value + ",";
                                                            var ss = document.getElementById(strid).value;
                                                            ss.replace(/code/, '');
                                                            if (obj.checked) {
                                                                document.getElementById(strid).value = ss + code;
                                                            }
                                                            alert(document.getElementById(strid).value);
                                                        }
                                                    </script>--%> 
                                                </DataItemTemplate>
                                                <CellStyle HorizontalAlign="Center"></CellStyle>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataColumn Caption="已承兑" FieldName="AcceptedShowName" 
                                                Width="55px" FixedStyle="Left">
                                                <Settings AutoFilterCondition="Equals" ShowFilterRowMenu="False" />
                                                <DataItemTemplate>
                                                    <dx:ASPxCheckBox runat="server" AutoPostBack="true" ID="chkagv"
                                                        Checked='<%# GetVisible(Convert.ToString(Eval("Accepted"))) %>'
                                                        ToolTip='<%# GetAccepted(Convert.ToString(Eval("AccountStatementItemCode"))) %>' 
                                                        Enabled='<%# Exported(Convert.ToString(Eval("StateValue"))) %>'
                                                        Text='<%# Eval("AcceptedShowName") %>' 
                                                         oncheckedchanged="chk_CheckedChanged_gv">
                                                    </dx:ASPxCheckBox>                                                    
                                                </DataItemTemplate>
                                                <CellStyle HorizontalAlign="Center"></CellStyle>
                                            </dx:GridViewDataColumn>
                                            <dx:GridViewDataTextColumn Caption="批号" FieldName="AccountStatementCode" 
                                                Width="120px" Visible="false">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="操作人" FieldName="showname" 
                                                Width="150px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataDateColumn Caption="操作时间" FieldName="UPDATEDATE" 
                                                Width="150px" UnboundType="DateTime">
                                                <PropertiesDateEdit DisplayFormatString="{0:yyyy-MM-dd HH:mm}" 
                                                    EditFormat="DateTime">
                                                    <CalendarProperties ClearButtonText="清空" TodayButtonText="今天">
                                                    </CalendarProperties>
                                                </PropertiesDateEdit>
                                                <Settings AllowAutoFilterTextInputTimer="True" />
                                            </dx:GridViewDataDateColumn>
                                            <dx:GridViewDataTextColumn Caption="银行参考号" FieldName="BankReference" 
                                                Width="150px" FixedStyle="Left">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="客户参考号" FieldName="CustomerReference" 
                                                Visible="False">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataDateColumn Caption="起息日" FieldName="ValueDate" Width="140px" 
                                                UnboundType="DateTime">
                                                <PropertiesDateEdit DisplayFormatString="{0:yyyy-MM-dd}"></PropertiesDateEdit>
                                            </dx:GridViewDataDateColumn>
                                            <dx:GridViewDataDateColumn Caption="入账日期" FieldName="EntryDate" Width="140px" UnboundType="DateTime">
                                                <Settings AutoFilterCondition="Greater" />
                                                <PropertiesDateEdit DisplayFormatString="{0:yyyy-MM-dd}"></PropertiesDateEdit>
                                            </dx:GridViewDataDateColumn>
                                            <dx:GridViewDataTextColumn Caption="交易金额" FieldName="TransactionAmount" 
                                                Width="120px" FixedStyle="Left" UnboundType="Decimal">
                                                <Settings AutoFilterCondition="GreaterOrEqual" />
                                                <PropertiesTextEdit DisplayFormatString="{0:N2}" />
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="已分配金额" FieldName="AppliedAmount" 
                                                Width="120px" FixedStyle="Left" UnboundType="Decimal">
                                                <Settings AutoFilterCondition="GreaterOrEqual" />
                                                <PropertiesTextEdit DisplayFormatString="{0:N2}" />
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="剩余金额" FieldName="TransactionAmountLeft" 
                                                Width="120px" FixedStyle="Left" UnboundType="Decimal">
                                                <Settings AutoFilterCondition="GreaterOrEqual" />
                                                <PropertiesTextEdit DisplayFormatString="{0:N2}" />
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="币 种" FieldName="Currency" 
                                                Width="100px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="产品类型" FieldName="ProductType" Width="160px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="交易说明" FieldName="TransactionDescription" 
                                                Width="160px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="额外信息" FieldName="ExtraInformation" 
                                                Width="240px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="汇款人/开票人名称" FieldName="OrderingPartyName" 
                                                Width="240px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="汇款人/开票人账户" FieldName="OrderingPartyAccount" 
                                                Width="200px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="定购方银行名称" FieldName="OrderingPartyBankName" 
                                                Width="300px">
                                            </dx:GridViewDataTextColumn>                                        
                                            <dx:GridViewDataTextColumn Caption="付款细节" FieldName="PaymentDetails" 
                                                Width="220px">
                                            </dx:GridViewDataTextColumn> 
                                            <dx:GridViewDataTextColumn Caption="收款方式" FieldName="AccountsReceivable" Width="100px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="客户编号" FieldName="CustomerCode" 
                                                Width="90px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="客户名称" FieldName="CustomerName" 
                                                Width="230px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="出票人" FieldName="MOPerson" Width="160px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataDateColumn Caption="到期日" FieldName="MaturityDate" Width="160px" UnboundType="DateTime">
                                                <Settings AutoFilterCondition="Greater" />
                                                <PropertiesDateEdit DisplayFormatString="{0:yyyy-MM-dd}"></PropertiesDateEdit>
                                            </dx:GridViewDataDateColumn>
                                            <dx:GridViewDataTextColumn Caption="公司" FieldName="CoName" Width="250px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="状态" FieldName="StateText" Width="70px">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="状态值" FieldName="StateValue" Visible="false">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Caption="备注" FieldName="Remarks" Visible="False">
                                            </dx:GridViewDataTextColumn>
                                        </Columns>
                                        <TotalSummary>
                                            <dx:ASPxSummaryItem FieldName="TransactionAmount" SummaryType="Sum" 
                                                ShowInColumn="交易金额" ValueDisplayFormat="c" />
                                        </TotalSummary>
                                        <SettingsBehavior ColumnResizeMode="Control" AllowSelectByRowClick="True"></SettingsBehavior>
                                        <SettingsPager PageSize="25">
                                        </SettingsPager>
                                        <Settings ShowFilterRow="True" ShowGroupPanel="True"  ShowFilterRowMenu="true"
                                            ShowHorizontalScrollBar="True" VerticalScrollableHeight="22" ShowFilterBar="Visible">
                                        </Settings>
                                    </dx:ASPxGridView> 
                                    <div style="margin:20px 0 0 35px; text-align:center;">
                                        <div style="margin:5px 0 0 25px; float:left; text-align:left;">
                                            <asp:Label runat="server" Text="每页显示："></asp:Label>
                                            <input type="text" class="mctxt" value="25" id="txtPageSize" 
                                            style="width:35px;" runat="server" onblur="txtIsPositiveNumber2(this.id);" />
                                            <asp:Button runat="server" ID="btnimportedpagesize" CssClass="cmdStyle" Text="页码设置" 
                                            style="margin-left:20px;"
                                            OnClick="btnimportedpagesize_Click" />
                                        </div>
                                        <asp:Button runat="server" ID="btnImportedExport" CssClass="cmdStyle" Text="导出_xls" 
                                            style="margin-left:20px;"
                                            OnClick="btnImportedExport_Click" />
                                    </div>
                                </dx:ContentControl>
                           </ContentCollection>
                        </dx:TabPage>
                        <dx:TabPage Name="tabmcimport" Text="收款信息导入" Visible="true">
                            <ContentCollection>
                                <dx:ContentControl runat="server" SupportsDisabledAttribute="True">
                                    <div class="mcinformation">
                                        <div style="margin:10px 20px 5px 45px; width:100%; height:25px;">
                                            <div style="text-align:right; font-size:18px; float:left; width:140px; margin:5px 0px 0px 0px; font-weight:bold;">
                                                <asp:Label ID="ASPxLabel20" runat="server" Text="请选择公司："></asp:Label>
                                            </div>
                                            <div style="margin:5px 0 0 5px;">
                                                <dx:ASPxComboBox ID="ddlcompanyimport" runat="server">
                                                </dx:ASPxComboBox>
                                            </div>
                                        </div>
                                        <div style="margin:10px 20px 5px 45px; width:100%; height:25px;">
                                            <div style="text-align:right; font-size:18px; float:left; width:140px; margin:5px 0px 0px 0px; font-weight:bold;">
                                                <asp:Label ID="ASPxLabel1" runat="server" Text="Excel 路径："></asp:Label>
                                            </div>
                                            <div style="margin:5px 0 0 5px;">                                      
                                                <dx:ASPxUploadControl ID="fileload" runat="server" 
                                                    CssClass="floatleft" Width="392px">                                        
                                                    <BrowseButton Text="浏览...">
                                                    </BrowseButton>
                                                </dx:ASPxUploadControl>
                                                <dx:ASPxButton ID="btnload" runat="server" Text="Load" 
                                                 CssClass="btnload" OnClick="btnload_Click">
                                                </dx:ASPxButton>        
                                            </div>
                                        </div>                                            
                                        <fieldset class="fieldset">
                                            <legend class="lblfieldset"><label class="lblfieldset">已获取到的模版数据</label></legend>
                                            <div style="padding:2px 3px 2px 3px;">
                                                <dx:ASPxGridView ID="gvreadyforimport" Width="100%" runat="server" 
                                                    AutoGenerateColumns="False" KeyFieldName="rowindex" ClientInstanceName="gvreadyforimport"
                                                    OnAfterPerformCallback="gvreadyforimport_AfterPerformCallback" 
                                                    OnRowCommand="gvreadyforimport_RowCommand">
                                                    <Columns>
                                                        <dx:GridViewDataColumn Caption="删除" Width="40px" FixedStyle="Left">
                                                            <DataItemTemplate>
                                                                <asp:Button ID="imgbtnDelete" runat="server" AlternateText="删除"
                                                                    CommandArgument='<%# Eval("rowindex") %>' CommandName="delete"
                                                                    CssClass="cmdStylegvdelete" 
                                                                    OnClientClick="return confirm('你确定要移除');" />
                                                            </DataItemTemplate> 
                                                            <CellStyle HorizontalAlign="Center">
                                                            </CellStyle>
                                                        </dx:GridViewDataColumn>
                                                        <%--<dx:GridViewDataCheckColumn Caption="手续费" FieldName="HandlingFee" Width="50px" 
                                                            FixedStyle="Left" UnboundType="Boolean">
                                                            <DataItemTemplate>
                                                                <asp:CheckBox runat="server" AutoPostBack="true" 
                                                                Checked='<%# GetVisible(Convert.ToString(Eval("HandlingFee"))) %>' 
                                                                ToolTip='<%# GetHandlingFee(Convert.ToString(Eval("rowindex"))) %>' 
                                                                OnCheckedChanged="chk_CheckedChanged" />
                                                            </DataItemTemplate>  
                                                            <CellStyle HorizontalAlign="Center">
                                                            </CellStyle>
                                                            <PropertiesCheckEdit DisplayTextChecked="是" DisplayTextUnchecked="否">
                                                            </PropertiesCheckEdit>
                                                        </dx:GridViewDataCheckColumn>--%>
                                                        <dx:GridViewDataTextColumn Caption="手续费" 
                                                            FieldName="HandlingFeeShowName" Width="55px" FixedStyle="Left">
                                                            <Settings AutoFilterCondition="Equals" ShowFilterRowMenu="False" />
                                                            <DataItemTemplate>
                                                                <dx:ASPxCheckBox  runat="server" AutoPostBack="true" ID="chkhgv"
                                                                    Checked='<%# GetVisible(Convert.ToString(Eval("HandlingFee"))) %>' 
                                                                    ToolTip='<%# GetHandlingFee(Convert.ToString(Eval("rowindex"))) %>' 
                                                                    Text='<%# Eval("HandlingFeeShowName") %>'                           
                                                                    oncheckedchanged="chk_CheckedChanged">
                                                                </dx:ASPxCheckBox>
                                                            </DataItemTemplate>
                                                            <CellStyle HorizontalAlign="Center"></CellStyle>
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="已承兑" 
                                                            FieldName="AcceptedShowName" Width="55px" FixedStyle="Left">
                                                            <Settings AutoFilterCondition="Equals" ShowFilterRowMenu="False" />
                                                            <DataItemTemplate>
                                                                <dx:ASPxCheckBox  runat="server" AutoPostBack="true" ID="chkhgv"
                                                                    Checked='<%# GetVisible(Convert.ToString(Eval("Accepted"))) %>' 
                                                                    ToolTip='<%# GetAccepted(Convert.ToString(Eval("rowindex"))) %>' 
                                                                    Text='<%# Eval("AcceptedShowName") %>'                           
                                                                    oncheckedchanged="chk_CheckedChanged">
                                                                </dx:ASPxCheckBox>
                                                            </DataItemTemplate>
                                                            <CellStyle HorizontalAlign="Center"></CellStyle>
                                                        </dx:GridViewDataTextColumn>
                                                        <%--<dx:GridViewDataCheckColumn Caption="已承兑" FieldName="Accepted" Width="50px" 
                                                            FixedStyle="Left" UnboundType="Boolean">
                                                            <DataItemTemplate>
                                                                <asp:CheckBox runat="server" AutoPostBack="true" 
                                                                Checked='<%# GetVisible(Convert.ToString(Eval("Accepted"))) %>'
                                                                ToolTip='<%# GetAccepted(Convert.ToString(Eval("rowindex"))) %>' OnCheckedChanged="chk_CheckedChanged" />
                                                            </DataItemTemplate> 
                                                            <CellStyle HorizontalAlign="Center">
                                                            </CellStyle>
                                                            <PropertiesCheckEdit DisplayTextChecked="是" DisplayTextUnchecked="否">
                                                            </PropertiesCheckEdit>
                                                        </dx:GridViewDataCheckColumn>--%>
                                                        <dx:GridViewDataTextColumn Caption="银行参考号" FieldName="BankReference" 
                                                            Width="140px" FixedStyle="Left">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="客户参考号" FieldName="CustomerReference" Visible="false">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataDateColumn Caption="起息日" FieldName="ValueDate" 
                                                            Width="140px" UnboundType="DateTime">
                                                            <PropertiesDateEdit DisplayFormatString="{0:yyyy-MM-dd}"></PropertiesDateEdit>
                                                        </dx:GridViewDataDateColumn>
                                                        <dx:GridViewDataDateColumn Caption="入账日期" FieldName="EntryDate" Width="140px" UnboundType="DateTime">
                                                            <PropertiesDateEdit DisplayFormatString="{0:yyyy-MM-dd}"></PropertiesDateEdit>
                                                        </dx:GridViewDataDateColumn>
                                                        <dx:GridViewDataTextColumn Caption="交易金额" FieldName="TransactionAmount" 
                                                            Width="140px" FixedStyle="Left" UnboundType="Decimal">
                                                            <Settings AutoFilterCondition="GreaterOrEqual" />
                                                            <PropertiesTextEdit DisplayFormatString="{0:N2}" />
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="币 种" FieldName="Currency" 
                                                            Width="100px">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="产品类型" FieldName="ProductType" Width="160px">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="交易说明" FieldName="TransactionDescription" Width="200px">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="额外信息" FieldName="ExtraInformation" Width="200px">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="汇款人/开票人名称" FieldName="OrderingPartyName" Width="240px" FixedStyle="Left">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataColumn Caption="客户编号" FieldName="CustomerCode" 
                                                            Width="90px">
                                                            <DataItemTemplate>
                                                                <asp:TextBox runat="server" 
                                                                ToolTip='<%# Eval("rowindex") %>'
                                                                Text='<%# Eval("CustomerCode") %>' 
                                                                AutoPostBack="true" OnTextChanged="CustomerNo_CheckedChanged"></asp:TextBox>
                                                            </DataItemTemplate>
                                                        </dx:GridViewDataColumn>
                                                        <dx:GridViewDataTextColumn Caption="客户名称" FieldName="CustomerName" 
                                                            Width="230px">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="汇款人/开票人账户" FieldName="OrderingPartyAccount" Width="200px">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="定购方银行名称" FieldName="OrderingPartyBankName" Width="300px">
                                                        </dx:GridViewDataTextColumn>                                        
                                                        <dx:GridViewDataTextColumn Caption="付款细节" FieldName="PaymentDetails" Width="220px">
                                                        </dx:GridViewDataTextColumn> 
                                                        <dx:GridViewDataTextColumn Caption="收款方式" FieldName="AccountsReceivable" Width="220px">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="公司" FieldName="CoName" Width="240px">
                                                        </dx:GridViewDataTextColumn>
                                                    </Columns>
                                                    <TotalSummary>
                                                        <dx:ASPxSummaryItem FieldName="TransactionAmount" SummaryType="Sum" 
                                                            ShowInColumn="交易金额" ValueDisplayFormat="{0:N2}" />
                                                    </TotalSummary>
                                                        <SettingsBehavior ColumnResizeMode="Control" AllowSelectByRowClick="True"></SettingsBehavior>
                                                        <Settings ShowFilterRow="True" ShowGroupPanel="True" ShowFilterRowMenu="true"
                                                        ShowHorizontalScrollBar="True" VerticalScrollableHeight="22" 
                                                        ShowFooter="True" ShowFilterBar="Visible">
                                                        </Settings>
                                                        <SettingsPager PageSize="25">
                                                        </SettingsPager>
                                                </dx:ASPxGridView>                                                
                                            </div>
                                        </fieldset>                          
                                        <div style="margin:20px 0 0 35px; text-align:center;">
                                            <div style="margin:5px 0 0 25px; float:left; text-align:left;">
                                                <asp:Label ID="Label5" runat="server" Text="每页显示："></asp:Label>
                                                <input type="text" class="mctxt" value="25" id="txtPagesizeImporting" 
                                                style="width:35px;" runat="server" onblur="txtIsPositiveNumber2(this.id);" />
                                                <asp:Button runat="server" ID="btnPagesizeImporting" CssClass="cmdStyle" Text="页码设置" 
                                                style="margin-left:20px;"
                                                OnClick="btnPagesizeImporting_Click" />
                                            </div>                             
                                            <asp:Button runat="server" ID="btnImportAdd" CssClass="cmdStyle" Text="确 定"
                                                OnClick="btnImportAdd_Click" />
                                            <asp:Button runat="server" ID="btnImportingExport" CssClass="cmdStyle" Text="导出_xls" 
                                                style="margin-left:20px;"
                                                OnClick="btnImportingExport_Click" />
                                        </div>
                                    </div>
                                </dx:ContentControl>
                            </ContentCollection>
                        </dx:TabPage>
                        <dx:TabPage Name="tabmcinput" Text="收款录入" Visible="true">
                            <ContentCollection>
                                <dx:ContentControl runat="server" SupportsDisabledAttribute="True">
                                    <div style="margin:15px 0px 20px 0px;">
                                        <ul>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="公司："></asp:Label>
                                                <dx:ASPxComboBox ID="ddlCompany" runat="server" CssClass="floatleft" 
                                                    ValueType="System.String" Width="215px">
                                                </dx:ASPxComboBox>
                                                <span class="red">*</span>
                                            </li>
                                        </ul>
                                        <ul>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="收款方式："></asp:Label>
                                                <dx:ASPxComboBox ID="ddlAccountsReceivable" runat="server" CssClass="floatleft" 
                                                    ValueType="System.String" Width="215px">
                                                    <Items>
                                                        <dx:ListEditItem Text="银行汇款" Value="1" Selected="true" />
                                                        <dx:ListEditItem Text="承兑汇票" Value="2" />
                                                        <dx:ListEditItem Text="支票" Value="3" />
                                                        <dx:ListEditItem Text="信用证" Value="4" />
                                                    </Items>
                                                </dx:ASPxComboBox>
                                                <span class="red">*</span>
                                            </li>
                                        </ul>
                                        <ul>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="银行参考号："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtBankReference" Text="" CssClass="mctxt" 
                                                 onblur="IsNotNull(this.id);"></asp:TextBox>
                                                <span class="red">*</span>
                                            </li>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv"  Text="入账日期："></asp:Label>   
                                                <dx:ASPxDateEdit ID="txtEntryDate" runat="server" CssClass="floatleft"
                                                    DisplayFormatString="yyyy-MM-dd" EditFormat="Custom" 
                                                    EditFormatString="yyyy-MM-dd" Width="215px">
                                                </dx:ASPxDateEdit>
                                                <span class="red">*</span>
                                            </li>
                                        </ul>
                                        <ul>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="交易金额："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtTransactionAmount" Text="0" CssClass="mctxt"
                                                 onblur="txtIsNumberOnly(this.id);"></asp:TextBox>
                                                <span class="red">*</span>
                                            </li>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="汇款人/开票人名称："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtOrderingPartyName" Text="" CssClass="mctxt3"
                                                   onblur="IsNotNull(this.id);"></asp:TextBox>
                                                <span class="red">*</span>
                                            </li>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="定购方银行名称："></asp:Label>
                                                 <asp:TextBox runat="server" ID="txtOrderingPartyBankName" Text="" CssClass="mctxt3"
                                                 onblur="IsNotNull(this.id);"></asp:TextBox>
                                                <span class="red">*</span>
                                            </li>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text=""></asp:Label>
                                                <asp:CheckBox runat="server" ID="chkAcceted" Text="已承兑" />
                                            </li>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="客户参考号："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtCustomerReference" Text="" CssClass="mctxt"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="起息日："></asp:Label>
                                                <dx:ASPxDateEdit ID="txtValueDate" runat="server" 
                                                    DisplayFormatString="yyyy-MM-dd" EditFormat="Custom" 
                                                    EditFormatString="yyyy-MM-dd" Width="215px">
                                                </dx:ASPxDateEdit>
                                            </li>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="产品类型："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtProductType" Text="" CssClass="mctxt"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label ID="Label3" runat="server" CssClass="mclbldiv" Text="客户编号："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtCustomerCode" Text="" CssClass="mctxt3"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label ID="Label2" runat="server" CssClass="mclbldiv" Text="客户名称："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtCustomerName" Text="" CssClass="mctxt3"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="交易说明："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtTransactionDescription" Text="" 
                                                    CssClass="mctxt3"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="额外信息："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtExtraInformation" Text="" CssClass="mctxt3"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="汇款人/开票人账户："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtOrderingPartyAccount" Text="" 
                                                    CssClass="mctxt3"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="付款细节："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtPaymentDetails" Text="" CssClass="mctxt3"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="出票行："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtMOLine" Text="" CssClass="mctxt"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="出票人："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtMOPerson" Text="" CssClass="mctxt"></asp:TextBox>
                                            </li>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="到期日："></asp:Label>
                                                    <dx:ASPxDateEdit ID="txtMaturityDate" runat="server" 
                                                        DisplayFormatString="yyyy-MM-dd" EditFormat="Custom" 
                                                        EditFormatString="yyyy-MM-dd" Width="215px">
                                                    </dx:ASPxDateEdit>
                                            </li>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="备注："></asp:Label>
                                                <asp:TextBox runat="server" ID="txtRemarks" TextMode="MultiLine" Text="" 
                                                    CssClass="mctxt3"></asp:TextBox>
                                            </li>
                                        </ul>
                                        <ul>
                                            <li class="li2">
                                                <asp:Label runat="server" CssClass="mclbldiv" Text="  "></asp:Label>
                                                <asp:Button ID="btninptuadd" runat="server" Text="添 加" CssClass="cmdStyle"
                                                 OnClientClick="return Check();" OnClick="btninptuadd_Click" />
                                                <asp:Button ID="btnedit" runat="server" Text="保 存" CssClass="cmdStyle"
                                                    OnClientClick="return Check();" OnClick="btnedit_Click" 
                                                    Visible="False" />
                                                <asp:Button ID="Button2" runat="server" Text="重 置" CssClass="cmdStyle"
                                                    OnClick="btnreset_Click" />
                                                <script language="javascript" type="text/javascript">
                                                    function Check() {
                                                        var str = "";
                                                        var ddl = document.getElementById("tc_ddlCompany"); //根据DropDownList的客户端ID获取该控件
                                                        for (i = 0; i < ddl.options.length; i++) {
                                                            if (ddl.options[i].selected) {
                                                                str = ddl.options[i].value;
                                                                if (str == "-1") {
                                                                    alert("公司不能为空，请选择！");
                                                                    return false;
                                                                }
                                                            }
                                                        }
                                                        str = DeleteBlank("tc_txtBankReference");
                                                        if (str == null || str == "") {
                                                            alert("银行参考号不能为空！");
                                                            document.getElementById("txtBankReference").focus();
                                                            return false;
                                                        }
                                                        str = DeleteBlank("tc_txtEntryDate");
                                                        if (str == null || str == "") {
                                                            alert("入账日期不能为空！");
                                                            return false;
                                                        }
                                                        str = DeleteBlank("tc_txtTransactionAmount");
                                                        if (str == null || str == "") {
                                                            alert("交易金额不能为空！");
                                                            return false;
                                                        }
                                                        if ((Math.abs(str) + 0) == 0) {
                                                            alert("交易金额不能：0");
                                                            return false;
                                                        }
                                                        // SetConvertDiv('block');
                                                        return true;
                                                    }
                                                </script> 
                                            </li>
                                        </ul>
                                    </div>
                                </dx:ContentControl>
                            </ContentCollection>
                        </dx:TabPage>
                    </TabPages>                
                    <Paddings Padding="2px" PaddingLeft="5px" PaddingRight="5px"></Paddings>
                    <ContentStyle>
                        <Border BorderColor="#AECAF0" BorderStyle="Solid" BorderWidth="1px" />
                    </ContentStyle>
                </dx:ASPxPageControl>
                <script language="javascript" type="text/javascript">
                    //文本框输入只能为非负数
                    function txtIsPositiveNumber2(txtID) {
                        var a = document.getElementById(txtID).value;
                        if (!(Math.abs(a) == a) || a == "" || a < 1) {
                            alert("必须大于：0 ");
                            document.getElementById(txtID).value = "25";
                            document.getElementById(txtID).focus();
                            return false;
                        }
                        else
                        { return true; }
                    }
                </script>
                <asp:HiddenField ID="hidAccountStatementItemCode" runat="server" />
                <dx:ASPxGridViewExporter ID="gridreadied" runat="server" 
                    GridViewID="gvimported">
                </dx:ASPxGridViewExporter>
                <dx:ASPxGridViewExporter ID="gridready" runat="server" 
                    GridViewID="gvreadyforimport">
                </dx:ASPxGridViewExporter>
                <asp:HiddenField ID="hidCurrency" runat="server" Value="CNY" />
                <asp:HiddenField ID="hidHandlingFee" runat="server" Value="0" />  
                <asp:HiddenField ID="hidfirstflag" runat="server" Value="0" />   
                <asp:HiddenField ID="hidstatevalue" runat="server" Value="" />  
                <asp:HiddenField ID="hidappliedamount" runat="server" Value="0" />    
                <input type="text" id="txtrowindexHandlingFee" runat="server" style="display:none;" /> 
                <input type="text" id="txtrowindexAccepted" runat="server" style="display:none;" />    
                <input type="text" id="txtAccountStatementItemCodeHandlingFee" runat="server" style="display:none;" />   
                <input type="text" id="txtAccountStatementItemCodeAccepted" runat="server" style="display:none;" />             
            </ContentTemplate>
            <Triggers>
                <asp:PostBackTrigger ControlID="tc$btnload" />
                <asp:PostBackTrigger ControlID="tc$btnImportAdd" />
                <asp:PostBackTrigger ControlID="tc$btnImportingExport" />
                <asp:PostBackTrigger ControlID="tc$btnImportedExport" />
                <asp:PostBackTrigger ControlID="tc$btninptuadd" />
                <asp:PostBackTrigger ControlID="tc$btnedit" />
            </Triggers>
        </asp:UpdatePanel> 
        </div>
    </form>
</body>
</html>
